lib/repo-refs: Fix resolving collection-refs
authorMatthew Leeds <matthew.leeds@endlessm.com>
Wed, 20 Feb 2019 21:18:31 +0000 (13:18 -0800)
committerAtomic Bot <atomic-devel@projectatomic.io>
Mon, 15 Apr 2019 15:56:40 +0000 (15:56 +0000)
commit23304b8c15835e75e257c7eb589808e40f3e39c9
tree0a073a4e475707f9d533c39fc4d88bc649ba308c
parenta8754ae3708431d72be63723a6362a4edc82df84
lib/repo-refs: Fix resolving collection-refs

My last commit "lib/repo-refs: Resolve collection-refs in-memory and in
parent repos" changed ostree_repo_resolve_collection_ref() to check the
in-memory set of refs *after* failing to find the ref on disk but that's
not what we want. We want to use the in-memory set of refs first,
because those are the most up to date commits, and then fall back to the
on-disk repo and finally fall back to checking any parent repo. This
commit makes such a change to the order of operations, which is
consistent with how ostree_repo_resolve_rev() works.

Aside from this change being logical, it also fixes some unit test
failures on an unmerged branch of flatpak:
https://github.com/flatpak/flatpak/pull/2705

Also, tweak the comments here.

Closes: #1825
Approved by: jlebon
src/libostree/ostree-repo-refs.c